// app/controller/user.js
const BaseController = require('../core/base_controller');

class HotnewsController extends BaseController {
  //查询新闻列表
  async get() {
    const { ctx } = this;
    const { page, pageSize } = this.getPagination();
    const data = await ctx.service.hotnews.find(page, pageSize);

    this.success(data);
  }

  //查询新闻详情
  async getNewsDetail() {
    const { ctx } = this;
    const key = this.getParam('key');
    const data = await ctx.service.hotnews.findOne(key);

    this.success(data);
  }
}

module.exports = HotnewsController;